<template>
    <div>
       <p>{{num}}</p>
       <p>{{title}}</p>
       <p>{{dbNum}}</p>
       <hr>
       <button @click="addNum(10)">同步添加</button>
       <button @click="asyncAddNum(20)">异步添加</button>
    </div>
</template>

<script>
import { mapState,mapGetters, mapMutations, mapActions} from 'vuex'
export default {
    name:'',
    components: {

    },
    props: {

    },
    data() {
        return {

        };
    },
    computed:{
        ...mapState(['num','title']),
        ...mapGetters(['dbNum'])
    },
    methods: {
        ...mapMutations(['addNum']),
        ...mapActions(['asyncAddNum'])
    },
    
};
</script>

<style scoped lang="less">

</style>
